#ifndef DOWNLOADUNITS_H
#define DOWNLOADUNITS_H

#include <QWidget>

class DownloadListItemWidget;
class DownloadThreadManager;

class DownloadUnits : public QObject
{
    Q_OBJECT
public:
    explicit DownloadUnits(const QString& url,QWidget *parent = 0);
    ~DownloadUnits();

    DownloadListItemWidget* getDownloadItemWidget();
    void pause();
    void start();
    int getState() const;
    QString getUrl() const { return m_url;}
    void setStateChanged(const QString&);

signals:
    void removeItemWidget(const QString&);

public slots:
    void errorCode(QString errorString);
    void downloadingFinished();

protected:
    DownloadListItemWidget* m_downloadItem;
    DownloadThreadManager* m_downloadThread;
    QString m_url;
    bool m_pause;

};

#endif // DOWNLOADUNITS_H
